﻿@model DMHelper.Models.DDSheet
           
@{
    ViewBag.Title = "Feuille";
}
@Html.ActionLink("Retour", "FeuillesPerso", "Home")
<h2 style="text-align:center;">Feuille du personnage</h2>
<a href="javascript:window.print()">Imprimer la feuille</a>
<h3 style="text-align:left; color:White; background-color:Black; font-style:oblique">General information</h3>
<table id="XP" border="1" class="table" align="right">
    <tr align="center">
        <td style="font-weight:bold">XP</td>
    </tr>
       <tr align="center">
        <td style="font-weight:bold">@Html.DisplayFor(model => model.head.Experience.Value)</td>
    </tr>
</table>
<table id="Head" border="1" class="table">
    <tr align="center">
        <td colspan="2" style="font-weight:bold">Player Name:</td>
        <td colspan="3" style="font-weight:bold">@Html.DisplayFor(model => model.head.PlayerName.Value)</td>
        <td colspan="2" style="font-weight:bold">Character Name:</td>
        <td colspan="3" style="font-weight:bold">@Html.DisplayFor(model => model.head.Nom.Value)</td>
    </tr>
    <tr align="center">
        <td style="font-weight:bold">Alignment</td>
        <td>@Html.DisplayFor(model => model.head.Alignment.Value)</td>
        <td style="font-weight:bold">Religion/Deity</td>
        <td>@Html.DisplayFor(model => model.head.Deity.Value)</td>
        <td style="font-weight:bold">Race</td>

        <td>race</td>
        <td style="font-weight:bold">Gender</td>
        <td>@Html.DisplayFor(model => model.head.Sex.Value)</td>
        <td style="font-weight:bold">Size</td>
        <td>@Html.DisplayFor(model => model.head.Size.Value)</td>
    </tr>
    <tr align="center">
        <td colspan="2" style="font-weight:bold">Classes</td>
        <td colspan="4">@Html.DisplayFor(model => model.head.Class.Value)</td>
        <td colspan="2" style="font-weight:bold">Level</td>
        <td colspan="2">@Html.DisplayFor(model => model.head.Level.Value)</td>
    </tr>
</table>

<br />
<h3 style="text-align:left; color:White; background-color:Black; font-style:oblique">Abilities and stats</h3>
<table id="ini" border="1" class="table" align="right">
            <tr align="center">
            <td style="font-weight:bold; color:Black">Initiative =</td>
            <td style="font-weight:bold; background-color:Silver">Base Ini. +</td>
            <td style="font-weight:bold; background-color:Silver">Misc. Ini.</td>
        </tr>
        <tr align="center">
            <td style="font-weight:bold; color:Black">@Html.DisplayFor(model => model.stats.Initiative.Value)</td>
            <td style="font-weight:bold; background-color:Silver">@Html.DisplayFor(model => model.stats.baseInitative.Value)</td>
            <td style="font-weight:bold; background-color:Silver">@Html.DisplayFor(model => model.stats.miscInitiative.Value)</td>
        </tr>
    </table>
     <table id="Speed" border="1" class="table" align="right" style="margin-right:100px">
            <tr align="center">
            <td style="font-weight:bold; color:Black">Speed</td>
        </tr>
        <tr align="center">
            <td style="font-weight:bold; color:Black">@Html.DisplayFor(model => model.stats.Speed.Value)</td>
        </tr>
    </table>    
    <table id="Abilities" border="1" class="table">
            <tr align="center">
            <td style="font-weight:bold; color:Black">Ability</td>
            <td style="font-weight:bold; background-color:Silver">Score</td>
            <td style="font-weight:bold; background-color:Silver">Bonus</td>
        </tr>
@foreach (var item in Model.stats.listAbilities.Values)
{
        <tr align="center">
            <td style="font-weight:bold; color:Black">@Html.DisplayFor(model => item.abilityName.Value)</td>
            <td style="font-weight:bold; background-color:Silver">@Html.DisplayFor(model => item.baseScore.Value)</td>
            <td style="font-weight:bold; background-color:Silver">@Html.DisplayFor(model => item.abilityModifier.Value)</td>
        </tr>
}
    </table>
    
   
<br />
<h3 style="text-align:left; color:White; background-color:Black; font-style:oblique">Saves and HP</h3>
    <table id="HP" border="1" class="table" align="right">
            <tr align="center">
            <td style="font-weight:bold; color:Black">Total HP</td>
            <td style="font-weight:bold; background-color:Silver">Current HP</td>
        </tr>
        <tr align="center">
            <td style="font-weight:bold; color:Black">@Html.DisplayFor(model => model.combat.MaxHP.Value)</td>
            <td style="font-weight:bold; background-color:Silver">@Html.DisplayFor(model => model.combat.currentHP.Value)</td>
        </tr>
    </table>
    <table id="Saves" border="1" class="table">
        <tr align="center">
            <td style="font-weight:bold; color:Black">Save</td>
            <td style="font-weight:bold">Total</td>
            <td style="font-weight:bold">Base</td>
            <td style="font-weight:bold">Ability</td>
            <td style="font-weight:bold">Magic</td>
            <td style="font-weight:bold">Misc.</td>
        </tr>
@foreach (var item in Model.savingThrows.listAbilities.Values)
{
        <tr align="center">
            <td style="font-weight:bold; color:Black">@Html.DisplayFor(model => item.SavingThrowName.Value)</td>
            <td>@Html.DisplayFor(model => item.TotalSave.Value)</td>
            <td>@Html.DisplayFor(model => item.baseSave.Value)</td>
            <td>@Html.DisplayFor(model => item.abilityBonus.Value)</td>
            <td>@Html.DisplayFor(model => item.magicalBonus.Value)</td>
            <td>@Html.DisplayFor(model => item.miscBonus.Value)</td>
        </tr>
}
    </table>
        
<br />
<h3 style="text-align:left; color:White; background-color:Black; font-style:oblique">Armor class</h3>
    <table id="AC" border="1" class="table">
        <tr align="center">
            <td style="font-weight:bold; color:Black">AC:</td>
            <td style="font-weight:bold">@Html.DisplayFor(model => model.ac.TotalAC.Value)</td>
            <td style="font-weight:bold; color:Black">= 10 +</td>
            <td style="font-weight:bold; color:Black">Armor:</td>
            <td>@Html.DisplayFor(model => model.ac.ArmorBonus.Value)</td>
            <td style="font-weight:bold; color:Black">Shield:</td>
            <td>@Html.DisplayFor(model => model.ac.ShieldBonus.Value)</td>
            <td style="font-weight:bold; color:Black">Dex:</td>
            <td>@Html.DisplayFor(model => model.ac.DexBonus.Value)</td>
            <td style="font-weight:bold; color:Black">Size:</td>
            <td>@Html.DisplayFor(model => model.ac.SizeModifier.Value)</td>
            <td style="font-weight:bold; color:Black">Natural:</td>
            <td>@Html.DisplayFor(model => model.ac.NaturalArmorModifier.Value)</td>
            <td style="font-weight:bold; color:Black">Def.:</td>
            <td>@Html.DisplayFor(model => model.ac.DeflectionModifier.Value)</td>
            <td style="font-weight:bold; color:Black">Misc:</td>
            <td>@Html.DisplayFor(model => model.ac.MiscModifier.Value)</td>
        </tr>
        <tr align="center">
            <td colspan="2" style="font-weight:bold; color:Black">Touch:</td>
            <td colspan="2" style="font-weight:bold">@Html.DisplayFor(model => model.ac.TouchAC.Value)</td>
            <td colspan="2" style="font-weight:bold; color:Black">Flat-Footed:</td>
            <td colspan="2" style="font-weight:bold">@Html.DisplayFor(model => model.ac.FlatFootAC.Value)</td>
        </tr>
    </table>
<br />
<h3 style="text-align:left; color:White; background-color:Black; font-style:oblique">Combat</h3>
    <table id="BaB" border="1" class="table">
        <tr align="center">
          <td style="font-weight:bold; color:Black">Base Attack Bonus:</td>
          <td style="width:20px">
          <ul>
          @foreach (var item in Model.combat.baseAttackBonus.BABS) {
              <li>
          @Html.DisplayFor(model => item.Value);
          </li>
          }
          </ul>
          </td>
        </tr>
    </table>
    <br />
    <table id="AcItems" border="1" class="table" align="right">
        <tr align="center">
            <td style="font-weight:bold; color:Black">Equipped armor:</td>
            <td>@Html.DisplayFor(model => model.ac.ArmorName.Value)</td>
            <td style="font-weight:bold; color:Black">Max Dex:</td>
            <td>@Html.DisplayFor(model => model.ac.ArmorMaxDex.Value)</td>
            <td style="font-weight:bold; color:Black">Penalty:</td>
            <td>@Html.DisplayFor(model => model.ac.armorPenalty.Value)</td>
            <td style="font-weight:bold; color:Black">Weight</td>
            <td>@Html.DisplayFor(model => model.ac.ArmorWeight.Value)</td>
        </tr>
        <tr align="center">
            <td style="font-weight:bold; color:Black">Equipped Shield:</td>
            <td>@Html.DisplayFor(model => model.ac.ShieldName.Value)</td>
            <td style="font-weight:bold; color:Black">Max Dex:</td>
            <td>@Html.DisplayFor(model => model.ac.ShieldMaxDex.Value)</td>
            <td style="font-weight:bold; color:Black">Penalty:</td>
            <td>@Html.DisplayFor(model => model.ac.ShieldCheckPenalty.Value)</td>
            <td style="font-weight:bold; color:Black">Weight</td>
            <td>@Html.DisplayFor(model => model.ac.ShieldWeight.Value)</td>
        </tr>
    </table>
    <table id="Weapons" border="1" class="table">
        <tr align="center" style="background-color:Silver">
            <td style="font-weight:bold; color:Black">Weapon:</td>
            <td colspan="5" style="font-weight:bold">@Html.DisplayFor(model => model.combat.Weapons.ElementAt(1).Value.WeaponName.Value)</td>
        </tr>
        <tr align="center" style="background-color:Silver">
            <td style="font-weight:bold; color:Black">Attack bonus:</td>
            <td>@Html.DisplayFor(model => model.combat.Weapons.ElementAt(1).Value.AttackBonus.BABS)</td>
            <td style="font-weight:bold; color:Black">Damage:</td>
            <td>@Html.DisplayFor(model => model.combat.Weapons.ElementAt(1).Value.Damage.Value)</td>
            <td style="font-weight:bold; color:Black">Critical:</td>
            <td>@Html.DisplayFor(model => model.combat.Weapons.ElementAt(1).Value.Critical.Value)</td>
        </tr>
        <tr align="center" style="background-color:Silver">
            <td style="font-weight:bold; color:Black">Range:</td>
            <td>@Html.DisplayFor(model => model.combat.Weapons.ElementAt(1).Value.Range.Value)</td>
            <td style="font-weight:bold; color:Black">Type:</td>
            <td>@Html.DisplayFor(model => model.combat.Weapons.ElementAt(1).Value.Type.Value)</td>
            <td style="font-weight:bold; color:Black">Notes/ammunitions:</td>
            <td colspan="2">@Html.DisplayFor(model => model.combat.Weapons.ElementAt(1).Value.Notes.Value)</td>
        </tr>
        <tr align="center">
            <td style="font-weight:bold; color:Black">Weapon:</td>
            <td colspan="5" style="font-weight:bold">@Html.DisplayFor(model => model.combat.Weapons.ElementAt(2).Value.WeaponName.Value)</td>
        </tr>
        <tr align="center">
            <td style="font-weight:bold; color:Black">Attack bonus:</td>
            <td>@Html.DisplayFor(model => model.combat.Weapons.ElementAt(2).Value.AttackBonus.BABS)</td>
            <td style="font-weight:bold; color:Black">Damage:</td>
            <td>@Html.DisplayFor(model => model.combat.Weapons.ElementAt(2).Value.Damage.Value)</td>
            <td style="font-weight:bold; color:Black">Critical:</td>
            <td >@Html.DisplayFor(model => model.combat.Weapons.ElementAt(2).Value.Critical.Value)</td>
        </tr>
        <tr align="center">
            <td style="font-weight:bold; color:Black">Range:</td>
            <td>@Html.DisplayFor(model => model.combat.Weapons.ElementAt(2).Value.Range.Value)</td>
            <td style="font-weight:bold; color:Black">Type:</td>
            <td>@Html.DisplayFor(model => model.combat.Weapons.ElementAt(2).Value.Type.Value)</td>
            <td style="font-weight:bold; color:Black">Notes/ammunitions:</td>
            <td colspan="2">@Html.DisplayFor(model => model.combat.Weapons.ElementAt(2).Value.Notes.Value)</td>
        </tr>
        <tr align="center" style="background-color:Silver">
            <td style="font-weight:bold; color:Black">Weapon:</td>
            <td colspan="5" style="font-weight:bold">@Html.DisplayFor(model => model.combat.Weapons.ElementAt(3).Value.WeaponName.Value)</td>
        </tr>
        <tr align="center" style="background-color:Silver">
            <td style="font-weight:bold; color:Black">Attack bonus:</td>
            <td>@Html.DisplayFor(model => model.combat.Weapons.ElementAt(3).Value.AttackBonus.BABS)</td>
            <td style="font-weight:bold; color:Black">Damage:</td>
            <td>@Html.DisplayFor(model => model.combat.Weapons.ElementAt(3).Value.Damage.Value)</td>
            <td style="font-weight:bold; color:Black">Critical:</td>
            <td>@Html.DisplayFor(model => model.combat.Weapons.ElementAt(3).Value.Critical.Value)</td>
        </tr>
        <tr align="center" style="background-color:Silver">
            <td style="font-weight:bold; color:Black">Range:</td>
            <td>@Html.DisplayFor(model => model.combat.Weapons.ElementAt(3).Value.Range.Value)</td>
            <td style="font-weight:bold; color:Black">Type:</td>
            <td>@Html.DisplayFor(model => model.combat.Weapons.ElementAt(3).Value.Type.Value)</td>
            <td style="font-weight:bold; color:Black">Notes/ammunitions:</td>
            <td colspan="2">@Html.DisplayFor(model => model.combat.Weapons.ElementAt(3).Value.Notes.Value)</td>
        </tr>
        <tr align="center">
            <td style="font-weight:bold; color:Black">Weapon:</td>
            <td colspan="5" style="font-weight:bold">@Html.DisplayFor(model => model.combat.Weapons.ElementAt(4).Value.WeaponName.Value)</td>
        </tr>
        <tr align="center">
            <td style="font-weight:bold; color:Black">Attack bonus:</td>
            <td>@Html.DisplayFor(model => model.combat.Weapons.ElementAt(4).Value.AttackBonus.BABS)</td>
            <td style="font-weight:bold; color:Black">Damage:</td>
            <td>@Html.DisplayFor(model => model.combat.Weapons.ElementAt(4).Value.Damage.Value)</td>
            <td style="font-weight:bold; color:Black">Critical:</td>
            <td >@Html.DisplayFor(model => model.combat.Weapons.ElementAt(4).Value.Critical.Value)</td>
        </tr>
        <tr align="center">
            <td style="font-weight:bold; color:Black">Range:</td>
            <td>@Html.DisplayFor(model => model.combat.Weapons.ElementAt(4).Value.Range.Value)</td>
            <td style="font-weight:bold; color:Black">Type:</td>
            <td>@Html.DisplayFor(model => model.combat.Weapons.ElementAt(4).Value.Type.Value)</td>
            <td style="font-weight:bold; color:Black">Notes/ammunitions:</td>
            <td colspan="2">@Html.DisplayFor(model => model.combat.Weapons.ElementAt(4).Value.Notes.Value)</td>
        </tr>
    </table>
<br />
<h3 style="text-align:left; color:White; background-color:Black; font-style:oblique">Feats and skills</h3>
    
    <table id="Feats" border="1" class="table"  align="right">
        <tr align="center" style="background-color:Silver">
            <td style="font-weight:bold; color:Black; width:300px">Feats</td>
        </tr>
@foreach (var truc in Model.feats.feats)
{
        <tr align="center">
            <td>@Html.DisplayFor(model => truc.FeatName.Value)</td>
        </tr>
}
    </table>
    <table id="Skills" border="1" class="table">
        <tr align="center" style="background-color:Silver">
            <td style="font-weight:bold; color:Black">Skill</td>
            <td style="font-weight:bold; color:Black">Ability</td>
            <td style="font-weight:bold; color:Black">Modif.</td>
            <td style="font-weight:bold; color:Black">=</td>
            <td style="font-weight:bold; color:Black">Ranks</td>
            <td style="font-weight:bold; color:Black">+</td>
            <td style="font-weight:bold; color:Black">Ability modif.</td>
            <td style="font-weight:bold; color:Black">+</td>
            <td style="font-weight:bold; color:Black">Misc. modif.</td>
        </tr>
@foreach (var item in Model.skills.listeSkill.Values)
{
        <tr align="center">
            <td>@Html.DisplayFor(model => item.SkillName.Value)</td>
            <td>@Html.DisplayFor(model => item.keyAbilityName.Value)</td>
            <td>@Html.DisplayFor(model => item.totalSkill.Value)</td>
            <td>=</td>
            <td>@Html.DisplayFor(model => item.keyAbilityModifier.Value)</td>
            <td>+</td>
            <td>@Html.DisplayFor(model => item.ranksBonus.Value)</td>
            <td>+</td>
            <td>@Html.DisplayFor(model => item.miscBonus.Value)</td>
        </tr>
}
    </table>
<br />

<h3 style="text-align:left; color:White; background-color:Black; font-style:oblique">Inventory</h3>
    <table id="Langues" border="1" class="table" align="right">
        <tr align="center">
            <td colspan="4" style="font-weight:bold; color:Black; width:200px">Languages</td> 
        </tr>
@foreach(var item in Model.language.languages)
{
        <tr align="center">
            <td colspan="4">@Html.DisplayFor(model => item)</td>            
        </tr>
}
    </table>
    <table id="Inventaire" border="1" class="table">
        <tr align="center">
            <td style="font-weight:bold; color:Black; width:300px">Items</td>
            <td style="font-weight:bold; color:Black; width:20px">Weight</td>
        </tr>
@foreach(var item in Model.equipment.items)
{
        <tr align="center">
            <td style="width:300px">@Html.DisplayFor(model => item.Name.Value)</td>
            <td style="width:20px">@Html.DisplayFor(model => item.Weight.Value)</td>
        </tr>
}
    </table>
<br />
@Html.ActionLink("Modifier la feuille", "ModifFeuille", "Home", new {id=ViewBag.IdFeuille })
<br />
<br />
@Html.ActionLink("Retour", "FeuillesPerso", "Home")